3.292 \(\int \frac {a B+b B \cos (c+d x)}{(a+b \cos (c+d x))^2} \, dx\)

Optimal. Leaf size=50 \[ \frac {2 B \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d \sqrt {a-b} \sqrt {a+b}} \]

[Out]

2*B*arctan((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/d/(a-b)^(1/2)/(a+b)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {21, 2659, 205} \[ \frac {2 B \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d \sqrt {a-b} \sqrt {a+b}} \]

Antiderivative was successfully verified.

[In]

Int[(a*B + b*B*Cos[c + d*x])/(a + b*Cos[c + d*x])^2,x]

[Out]

(2*B*ArcTan[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(Sqrt[a - b]*Sqrt[a + b]*d)

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \frac {a B+b B \cos (c+d x)}{(a+b \cos (c+d x))^2} \, dx &=B \int \frac {1}{a+b \cos (c+d x)} \, dx\\ &=\frac {(2 B) \operatorname {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{d}\\ &=\frac {2 B \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b} d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 49, normalized size = 0.98 \[ -\frac {2 B \tanh ^{-1}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {b^2-a^2}}\right )}{d \sqrt {b^2-a^2}} \]

Antiderivative was successfully verified.

[In]

Integrate[(a*B + b*B*Cos[c + d*x])/(a + b*Cos[c + d*x])^2,x]

[Out]

(-2*B*ArcTanh[((a - b)*Tan[(c + d*x)/2])/Sqrt[-a^2 + b^2]])/(Sqrt[-a^2 + b^2]*d)

________________________________________________________________________________________

fricas [A]  time = 0.72, size = 177, normalized size = 3.54 \[ \left [-\frac {\sqrt {-a^{2} + b^{2}} B \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right )}{2 \, {\left (a^{2} - b^{2}\right )} d}, \frac {B \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right )}{\sqrt {a^{2} - b^{2}} d}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c))^2,x, algorithm="fricas")

[Out]

[-1/2*sqrt(-a^2 + b^2)*B*log((2*a*b*cos(d*x + c) + (2*a^2 - b^2)*cos(d*x + c)^2 + 2*sqrt(-a^2 + b^2)*(a*cos(d*
x + c) + b)*sin(d*x + c) - a^2 + 2*b^2)/(b^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + a^2))/((a^2 - b^2)*d), B*ar
ctan(-(a*cos(d*x + c) + b)/(sqrt(a^2 - b^2)*sin(d*x + c)))/(sqrt(a^2 - b^2)*d)]

________________________________________________________________________________________

giac [A]  time = 0.52, size = 78, normalized size = 1.56 \[ \frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )} B}{\sqrt {a^{2} - b^{2}} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c))^2,x, algorithm="giac")

[Out]

2*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(2*a - 2*b) + arctan((a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/
sqrt(a^2 - b^2)))*B/(sqrt(a^2 - b^2)*d)

________________________________________________________________________________________

maple [A]  time = 0.05, size = 45, normalized size = 0.90 \[ \frac {2 \arctan \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right ) B}{d \sqrt {\left (a -b \right ) \left (a +b \right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c))^2,x)

[Out]

2/d/((a-b)*(a+b))^(1/2)*arctan(tan(1/2*d*x+1/2*c)*(a-b)/((a-b)*(a+b))^(1/2))*B

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?`
 for more details)Is 4*b^2-4*a^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 0.50, size = 44, normalized size = 0.88 \[ \frac {2\,B\,\mathrm {atan}\left (\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a-b\right )}{\sqrt {a^2-b^2}}\right )}{d\,\sqrt {a^2-b^2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*a + B*b*cos(c + d*x))/(a + b*cos(c + d*x))^2,x)

[Out]

(2*B*atan((tan(c/2 + (d*x)/2)*(a - b))/(a^2 - b^2)^(1/2)))/(d*(a^2 - b^2)^(1/2))

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c))**2,x)

[Out]

Timed out

________________________________________________________________________________________